package com.hgkj.cloud.base.service.impl;

import com.hgkj.cloud.base.common.PageInfo;
import com.hgkj.cloud.base.dao.TenantOrderRecordMapper;
import com.hgkj.cloud.base.domain.TenantOrderRecord;
import com.hgkj.cloud.base.service.TenantOrderRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class TenantOrderRecordServiceImpl implements TenantOrderRecordService {

    @Autowired
    private TenantOrderRecordMapper tenantOrderRecordMapper;

    @Override
    public int deleteByPrimaryKey(Long id) {
        return tenantOrderRecordMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(TenantOrderRecord record) {
        return tenantOrderRecordMapper.insert(record);
    }

    @Override
    public int insertSelective(TenantOrderRecord record) {
        return tenantOrderRecordMapper.insertSelective(record);
    }

    @Override
    public TenantOrderRecord selectByPrimaryKey(Long id) {
        return tenantOrderRecordMapper.selectByPrimaryKey(id);
    }

    @Override
    public int updateByPrimaryKeySelective(TenantOrderRecord record) {
        return tenantOrderRecordMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(TenantOrderRecord record) {
        return tenantOrderRecordMapper.updateByPrimaryKey(record);
    }

    @Override
    public TenantOrderRecord getOrderRecord(Map<String, Object> map) {
        return tenantOrderRecordMapper.getOrderRecord(map);
    }

    @Override
    public List<TenantOrderRecord> listOrderRecordByCode(PageInfo pi, Map<String, Object> map) {
        if(pi != null){
            map.put("currentCount", pi.getCurrentCount());
            map.put("pageSize", pi.getPageSize());
        }
        return tenantOrderRecordMapper.listOrderRecordByCode(map);
    }

    @Override
    public long listOrderRecordByCodeCount(Map<String, Object> map) {
        return tenantOrderRecordMapper.listOrderRecordByCodeCount(map);
    }

    @Override
    public List<Map<String, Object>> listOrderRecordsAnalyze(Map<String, Object> map) {
        return tenantOrderRecordMapper.listOrderRecordsAnalyze(map);
    }

    @Override
    public List<TenantOrderRecord> listAllOrderRecords(PageInfo pi, Map<String, Object> map) {
        if(pi != null){
            map.put("currentCount", pi.getCurrentCount());
            map.put("pageSize", pi.getPageSize());
        }
        return tenantOrderRecordMapper.listAllOrderRecords(map);
    }

    @Override
    public long listAllOrderRecordsPageCount(Map<String, Object> map) {
        return tenantOrderRecordMapper.listAllOrderRecordsPageCount(map);
    }

    @Override
    public List<Map<String, Object>> getUserRecord(PageInfo pi,Map<String, Object> map) {
        if(pi != null){
            map.put("currentCount", pi.getCurrentCount());
            map.put("pageSize", pi.getPageSize());
        }
        return tenantOrderRecordMapper.getUserRecord(map);
    }

    @Override
    public Long getUserRecordCount(Map<String, Object> map) {
        return tenantOrderRecordMapper.getUserRecordCount(map);
    }
}
